<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    
    <title>代理商账户充值记录</title>
   <link href="${ctx}/style/style.css" rel="stylesheet" type="text/css" />
   <script language="JavaScript" src="${ctx}/scripts/jquery.js"></script>
	<script type="text/javascript"
			src="${ctx}/scripts/lhgdialog/lhgdialog.js"></script>		
	<script type="text/javascript">
		var pop;
		function add(){
			pop = $.dialog({ 
				lock: true, 
				width: '450px',
  				height: '120px',
  				max: false,
   				min: false,
  				title:  "账户充值",
			    content: 'url:Prepaidcard_toAgentRecharge.action',
			    ok : agentRecharge,
			    cancel: true
			});
		}
		function agentRecharge(){
			 var cardnumber =  pop.content.document.getElementById('cardnumber').value ;
			 var cardpwd =  pop.content.document.getElementById('cardpwd').value ;
			 if(cardnumber != '' && cardpwd != ''){
				 $.ajax({
					url: "Prepaidcard_agentRecharge.action?prepaidcard.cardnumber="+cardnumber+"&prepaidcard.cardpwd="+cardpwd,
					type : 'post',
					dataType : 'json',
					beforeSend:loading,
					dataFilter :function (data, textStatus) {
						$("#loading").hide();
						var result = eval("("+data+")");
						if(result.success == 'true'){
			         	    window.location.reload();
			         	}else{
							$.dialog.alert(result.data);
			         	}
			        } 
				});
			}else{
				return false;
			}	
		}
		function loading(){
			$("#loading").show();
		}
	</script>
 </head>
 <body>
  	<div class="place" >
	    <span>位置：</span>
	    <ul class="placeul">
	    	<li><a href="#">代理商账户充值记录</a></li>
	    </ul>
    </div>
    	
   	<div class="rightinfo">
    <div class="tools"  >
        <ul class="toolbar1">
        	<li onclick="add()"><span><img src="${ctx}/images/t01.png" /></span>充值</li>
        </ul>
    </div>
    <table class="imgtable" >
	    <thead>
		    <tr>
			    <th width="50px;">序号</th>
			    <th>充值时间</th>
			    <th>账户上次余额</th>
			    <th>充值卡卡号</th>
			    <th>充值卡密码</th>
			    <th>充值卡金额</th>
			    <th>账户本次余额</th>
		    </tr>
	    </thead>
	    <tbody>
	    	<s:if test="prepaidcardList==null || prepaidcardList.isEmpty()">
				<tr class="toolbar">
					<td colspan="10" align="left" height="25px">
						<font color="red">提示：未查询到数据!</font>
					</td>
				</tr>
			</s:if>
			<s:else>
				<s:iterator id="p" value="prepaidcardList" status="loop">
					<tr>
					    <td><s:property  value="#p.id" />&nbsp;</td>
					    <td><s:property  value="#p.usedate" />&nbsp;</td>
					    <td><s:property  value="#p.usebeforemoney" />&nbsp;</td>
					    <td style="width: 80px"><s:property  value="#p.cardnumber" />&nbsp;</td>
					    <td style="width: 80px"><s:property  value="#p.cardpwd" />&nbsp;</td>
					    <td><s:property  value="#p.cardmoney" />&nbsp;</td>
					    <td><s:property  value="#p.useaftermoney" />&nbsp;</td>
				    </tr>
				</s:iterator>
			</s:else>
	    </tbody>
    </table>
    <div class="pagin">
    	<div class="message">
			共
			<s:property value="totalCount" />
			条记录&nbsp;共
			<s:property value="totalPage" />
			页&nbsp;当前第
			<s:property value="currentPage" />
			页&nbsp;
		</div>
        <ul class="paginList">
	        <li class="paginItem">
				<pagetag:pages currentPage="${currentPage}"
					totalPage="${totalPage}" styleClass="page" theme="text">
					<input type="hidden" name="callpaymentrecord.start_time"
						value="${callpaymentrecord.start_time}" />
					<input type="hidden" name="callpaymentrecord.end_time"
						value="${callpaymentrecord.end_time}" />
				</pagetag:pages>
			</li>
        </ul>
    </div>
   
	<script type="text/javascript">
		$('.imgtable tbody tr:odd').addClass('odd');
	</script>
	<div id="loading" style="position:absolute; display:none; left:-1px; top:1px; width:100%; height:100%; background-color:#FFFFFF; 
			filter:alpha(opacity=50);-moz-opacity:0.5; -khtml-opacity: 0.5;opacity: 0.5; z-index:1000;"> 
		<div  style="position:absolute;left:180px;top:150px;width:100px;height:100px;background-color:#FFFFFF; z-index:9001;" >
			<img alt="" id="wait1" src="${ctx}/images/loading.gif" >
		</div>
	</div>
  </body>
</html>
